﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace PayloadTracker.APRS.SoundModem
{
    public partial class SoundModemSetup : PayloadTracker.APRS.IAPRSProviderSetup
    {

        public SoundModemSetup()
        {
            InitializeComponent();

            foreach(var device in SoundModem.GetAvailableDevices())
            {
                comboBox1.Items.Add(device);
            }
            comboBox1.SelectedIndex = 0;
        }

        public override void Reset()
        {
            comboBox1.SelectedIndex = 0;
        }

        public override bool ValidateInput()
        {
            return true;
        }

        public override IAPRSProvider CreateInstance()
        {
            return new SoundModem(((int)((FSK.CaptureDevice)comboBox1.SelectedItem).ID));
        }
    }
}
